package com.libgdxbar.pvzlikegame.objects;

import com.badlogic.gdx.graphics.Color;
import com.badlogic.gdx.graphics.glutils.ShapeRenderer;
import com.badlogic.gdx.math.Vector2;
import com.libgdxbar.pvzlikegame.entities.LocationEntity;

import org.libgdxbar.projects.interfaces.renderer.ShapeRenderable;

// 最简示例 植物类
// 继承 LocationEntity 即包含位置的实体
// 实现 ShapeRenderable 接口 使用 ShapeRenderer 渲染图形
public class BasePlant extends LocationEntity implements ShapeRenderable {
    public BasePlant(float x, float y) {
        super(x, y);
    }

    // 实现渲染方法
    @Override
    public void render(ShapeRenderer renderer) {
        renderer.setColor(Color.GREEN);
        Vector2 position = getPosition();
        renderer.rect(position.x, position.y, 50, 50);
    }

    // 实现植物逻辑
    @Override
    public void run(float delta) {
        super.run(delta);
    }
}
